package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper {

    /**
     * 根据用户名查询用户
     * @param username
     * @return
     */
    @Select("select * from user where username = #{username}")
    User getByUsername(String username);

    /**
     * 根据id查询用户
     * @param currentId
     * @return
     */
    @Select("select * from user where id = #{currentId}")
    User getById(Long currentId);

    /**
     * 修改用户信息
     * @param user
     */
    void update(User user);
}
